package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable3;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable3.UserBaseTable3DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable3.vo.*;

/**
 * 个人贴息贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable3Mapper extends BaseMapperX<UserBaseTable3DO> {

    default PageResult<UserBaseTable3DO> selectPage(UserBaseTable3PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable3DO>()
                .eqIfPresent(UserBaseTable3DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable3DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable3DO::getPropertyStatus, reqVO.getPropertyStatus())
                .betweenIfPresent(UserBaseTable3DO::getUnitTime, reqVO.getUnitTime())
                .eqIfPresent(UserBaseTable3DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable3DO::getJob, reqVO.getJob())
                .betweenIfPresent(UserBaseTable3DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable3DO::getId));
    }

    default List<UserBaseTable3DO> selectList(UserBaseTable3ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable3DO>()
                .eqIfPresent(UserBaseTable3DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable3DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable3DO::getPropertyStatus, reqVO.getPropertyStatus())
                .betweenIfPresent(UserBaseTable3DO::getUnitTime, reqVO.getUnitTime())
                .eqIfPresent(UserBaseTable3DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable3DO::getJob, reqVO.getJob())
                .betweenIfPresent(UserBaseTable3DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable3DO::getId));
    }

}
